//===============================================================================
// Microsoft Architecture Strategy Team
// LitwareHR - SaaS Sample Application
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================


using System;
using System.Collections.Generic;
using System.Text;

namespace DependencyTest.Helpers 
{
    public sealed class Check
    {
        public int GetOsBuild()
        {
            return OperatingSystem.GetOsBuild();
        }
        public bool ForWindowsPowerShellOnVista()
        {
            return InstalledHotFixes.IsHotFixInstalled("928439");
        }
        public bool ForWindowsPowerShellExecutionPolicy(string desiredPolicy)
        {
            return RegistryHelper.IsValueAt(@"SOFTWARE\microsoft\powershell\1\shellids\Microsoft.PowerShell","ExecutionPolicy",desiredPolicy);
        }
        public bool ForSoftwarePacakge(string packageName)
        {
            return RegistryHelper.IsInKey(@"SOFTWARE\microsoft\Windows\CurrentVersion\Uninstall",
                "DisplayName", packageName);
        }
        public bool ForServerRole(string roleName)
        {
            return false;
        }
        public bool ForServerFeature(string featureName)
        {
            return false;
        }
        public bool ForOsBuildGreaterThan(int buildNumber)
        {
            int actualBuildNumber = OperatingSystem.GetOsBuild();
            return ( actualBuildNumber >= buildNumber);
        } 
    }
}
